cmake_minimum_required(VERSION 3.16)

project(common VERSION 0.1 LANGUAGES CXX)
add_library(${PROJECT_NAME} STATIC)

## Compilation options
target_include_directories(${PROJECT_NAME} BEFORE PUBLIC ${CMAKE_SOURCE_DIR})
target_include_directories(${PROJECT_NAME} BEFORE PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(PkgConfig REQUIRED)

target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)

set(PROJECT_SOURCES
    eventfilter.cpp
    eventfilter.h
    lineedit.cpp
    lineedit.h
    widget.cpp
    widget.h
    utils.h
)
source_group("" FILES ${PROJECT_SOURCES})
target_sources(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCES})
